﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Group3.MediaTool.Interface;

namespace Group3.MediaTool.Provider
{
    public abstract class DataStoreProvider : IDataProvider<IObjectRelationModel>
    {
        public e_DataStoreProvider StoreProvider { get; set; }

        public string Connect { get; set; }

        public string Store { get; set; }

        public virtual bool ExecuteAction<T>(Action<T> action, T parameter)
        {
            try
            {
                action(parameter);
                return true;
            }
            catch(Exception)
            {
                return false;
            }
        }

        public virtual IEnumerable<IObjectRelationModel> GetDataFromStore<T>() where T : IObjectRelationModel
        {
            throw new NotImplementedException();
        }

        public virtual IEnumerable<IObjectRelationModel> GetDataFromStore<T>(Predicate<T> filterstmt) where T : IObjectRelationModel
        {
            throw new NotImplementedException();
        }

        public virtual bool SaveChanges(IObjectRelationModel orm)
        {
            throw new NotImplementedException();
        }

    }

}
